<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Rank extends Model
{

    protected $table = 'rank';

    public $timestamps = false;

    protected $fillable = [
        'id',
        'name',
        'value_up',
        'value_below',
        'icon',
        'level',
        'admin_id',
        'time',
        'icon_oss',
    ];

    protected $casts = ['icon'];

    public function getIconAttribute($value)
    {
        return \App\Library\HandleFile::handleFilePath($value, $this->icon_oss);
    }
}
